!!!
html(ng-app="mainApp")
	head
		link(type="css/text",rel="stylesheet",href="less/bootstrap/bootstrap.css")
	body
		.navbar.navbar-fixed-top.navbar-inverse(role="navigation")
			.container
				.navbar-header
					button.navbar-toggle(data-toggle="collapse",data-target=".navbar-collapse")
						span.icon-bar
						span.icon-bar
						span.icon-bar
					a.navbar-brand(href="#") 轻客
				.collapse.navbar-collapse
					ul.nav.navbar-nav
						li
							a(href="#dashboard") dashboard
						li
							a(href="#cms") 内容管理
						li.active
							a(href="#user") 用户管理
		
		.container(ng-view,style="padding:60px")
		//- libs
		script(src="assets/jquery.js")
		script(src="assets/angular/angular.js")
		script(src="assets/angular/angular-route.js")
		script(src="assets/angular/angular-resource.js")

		
		//- models
		script
			var  userServices = angular.module('userServices', ['ngResource']);
			userServices.factory('User', ['$resource',
				function User($resource){
					return $resource('/user',{},{});
			}]);

		//- script
		//- 	var payrollServices = angular.module('payrollServices',['ngResource']);

		//- 	//- var Payroll = $resource('/payroll.json')
		//- 	payrollServices.factory('Payroll',['$resource',
		//- 		function Payroll($resource){
		//- 			return $resource('/payroll',{},{
		//- 				find:{
		//- 					method:'get',
		//- 					url:'payroll/find',
		//- 					isArray:true
		//- 				}
		//- 			});
		//- 		}
		//- 	]);
		//- //- controllers
		script
			var userControllers = angular.module('userControllers',['userServices']);
			userControllers.controller('UserListCtrl',['$scope','$http','User',
				function UserListCtrl($scope, $http, User){
					$scope.users = User.query();
					$scope.sendMessage = function(user){
						$http.post('/push/'+user.id, user);
					}

					$scope.sync = function(){
						$http.get('user/sync')
					}
				}
			]) 
		//- script
		//- 	var payrollControllers = angular.module('payrollControllers',['payrollServices'])
		//- 	payrollControllers.controller('PayrollSubmitCtrl',['$scope','Payroll',
		//- 		function PayrollSubmitCtrl($scope,Payroll){
		//- 			$scope.payrolls = Payroll.find({status:'submit'});
		//- 		}
		//- 	]);
		//- 	payrollControllers.controller('PayrollRejectCtrl',['$scope','Payroll',
		//- 		function PayrollRejectCtrl($scope,Payroll){
		//- 			$scope.payrolls = Payroll.find({status:'reject'});
		//- 		}
		//- 	]);
		//- 	payrollControllers.controller('PayrollPassCtrl',['$scope','Payroll',
		//- 		function PayrollPassCtrl($scope,Payroll){
		//- 			$scope.payrolls = Payroll.find({status:'pass'});
		//- 		}
		//- 	]);

		
		//- routes
		script
			var mainApp = angular.module('mainApp',['ngRoute','userControllers']);
			mainApp.config(['$routeProvider',
				function routeProvider($routeProvider){
					$routeProvider
						.when('/user',{
							templateUrl:'template/user/list',
							controller:'UserListCtrl'	
						})
						.otherwise({
							redirectTo:'/user'	
						})
				}	
			])
		//- script
		//- 	var mainApp = angular.module('mainApp',[
		//- 		'ngRoute',
		//- 		'payrollControllers'
		//- 	]);

		//- 	mainApp.config(['$routeProvider',
		//- 		function routeProvider($routeProvider){
		//- 			$routeProvider
		//- 				.when('/payroll/find/submit',{
		//- 					templateUrl:'template/payroll/submitList',
		//- 					controller:'PayrollSubmitCtrl'	
		//- 				})
		//- 				.when('/payroll/find/reject',{
		//- 					templateUrl:'template/payroll/rejectList',
		//- 					controller:'PayrollRejectCtrl'	
		//- 				})
		//- 				.when('/payroll/find/pass',{
		//- 					templateUrl:'template/payroll/passList',
		//- 					controller:'PayrollRejectCtrl'	
		//- 				})
		//- 				.otherwise({
		//- 					redirectTo:'/payroll/find/submit'	
		//- 				})
		//- 		}
		//- 	]);

		//- 